<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class AdminSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        $items = $this->getItems();
        if (!$items) {
            return;
        }
        foreach ($items as $item) {
            DB::table('admins')->insert($item);
        }
    }

    public function getItems()
    {
        return [
            [
                'id' => 1,
                'created_id' => 1,
                'created_at' => 0,
                'updated_id' => 0,
                'updated_at' => 0,
                'deleted_id' => 0,
                'deleted_at' => 0,
                'name' => 'Admin',
                'nickname' => '',
                'password' => '$2y$10$loJxi.dSj/JmdKqkEKYuVOE5hTxP5GOyZgCaFEfpMBsrAx8YBF3Ly',
                'email' => 'admin@163.com',
                'phone' => '12345678900',
                'avatar' => '',
                'sex' => 0,
                'type' => 0,
                'lang' => 'zh_cn',
                'remark' => '超级管理员',
                'sorting' => 0,
                'auto_logout' => 15,
                'last_login_time' => 0,
                'last_login_ip' => '127.0.0.1',
                'token' => 'token-cache',
                'token_expire' => 0,
                'status' => 1,
            ],
        ];
    }
}
